package naga.x.event;

public final class Event {

	private final int type;
	private final Object[] params;
	
	public Event(int type, Object... params) {
		this.type = type;
		this.params = params;
	}
	
	public int getType() {
		return type;
	}
	
	public <T> T getParameter() {
		return getParameter(0);
	}
	
	public <T> T getParameter(int index) {
		if (index >= 0 && params != null && index < params.length) {
			return (T) params[index];
		}
		return null;
	}
	
	public Object[] getParameters() {
		return params;
	}
	
}
